package labox.innovation.gameserver.model;

import java.util.List;

import labox.innovation.gameserver.GameTimeController;
import labox.innovation.gameserver.ai.CtrlIntention;
import labox.innovation.gameserver.ai.L2PlayerAI;
import labox.innovation.gameserver.datatables.ItemTable;
import labox.innovation.gameserver.handler.IItemHandler;
import labox.innovation.gameserver.handler.ItemHandler;
import labox.innovation.gameserver.model.L2ItemInstance.ItemGradeType;
import labox.innovation.gameserver.model.actor.L2Attackable;
import labox.innovation.gameserver.model.actor.L2Character;
import labox.innovation.gameserver.model.actor.instance.FuzePcInstance;
import labox.innovation.gameserver.model.actor.instance.FuzeRepairerInstance;
import labox.innovation.gameserver.network.SystemMessageId;
import labox.innovation.gameserver.network.serverpackets.CreatureSay;
import labox.innovation.gameserver.network.serverpackets.SystemMessage;
import labox.innovation.gameserver.templates.item.L2EtcItemType;
import labox.innovation.gameserver.templates.item.L2Item;
import labox.innovation.gameserver.templates.item.MobItemCreateConfig;

/**
 * 托管员 即自动战斗<BR><BR>
 *
 */
public class FuzeTrusteeInstance implements DropItemSelectInterface {
	
	/***拾取***/
	private int solution =1;	//药水 0关闭 1开启   默认1 
	private int gemstone =1;	//宝石0关闭 1开启   默认1 
	private int scroll =1;		//卷轴0关闭 1开启  默认1 
	private int faEquipment =1;		//法器装备 0关闭 1开启    默认1
	private int baoEquipment =1;		//宝器装备 0关闭 1开启   默认1 
	private int lingEquipment =1;		//灵器装备 0关闭 1开启   默认1
	private int zhiEquipment =1;	//至宝装备 0关闭 1开启  默认1 
	private int shenEquipment =1;	//神器装备 0关闭 1开启  默认1 

	/***技能或buffer***/
	private int isUseSkill =1;		//自动战斗时是否使用技能
	private int skillId_1 =-1;		//战斗设置技能1
	private int skillId_2 =-1;		//战斗设置技能2
	private int skillId_3 =-1;		//战斗设置技能3
	private int skillId_4 =-1;		//战斗设置技能4
	private int isUseState =1;		//自动战斗时是否使用buffer药
	private int stateId_1 =-1;		//战斗设置状态1
	private int stateId_2 =-1;		//战斗设置状态2
	private int stateId_3 =-1;		//战斗设置状态3
	private int stateId_4 =-1;		//战斗设置状态4

	/***角色保护设置***/
	private int hpoff =1;			//自动补给生命值下限  0 关闭生命保护
	private int hpCP =50;			//自动补给生命值下限  0 关闭生命保护  hpCP>0开启生命保护    默认50%
	private int spoff =1;			//自动补给魔法值下限 0
	private int spCP =50;			//自动补给魔法值下限	0 关闭魔法保护  spCP>0开启魔法保护	 默认50%
	private int autoBuyRed =0;		//自动够买红药	0为不购买  1为购买		默认关闭
	private int redItemId =-1;		//购买红药物品ID	默认  最低级的		
	private int autoBuyBlue =0;	//自动购买蓝药	0为不购买  1为购买		默认关闭
	private int blueItemId =-1;		//购买蓝药物品ID  默认 最低级的		

	private int hpBeastOff =0;		//神兽自动补给生命 开关
	private int hpBeast =50;		//神兽自动补给生命值下限  0 关闭生命保护  hpBeast>0开启生命保护	
	private int healSkillId =-1;	//自动治疗技能给神兽加生命	
	private int dealSpawn =0;		//自动召唤 0关闭  1开启
	private int spawnSkillId =-1;	//自动召唤技能

	private int hpPetOff =0;		//
	private int hpPet =50;			//宠物自动补给生命值下限  0 关闭生命保护  hpPet>0开启生命保护
	private int petHealSkillId =-1; //宠物自动治疗技能或红药加生命
	private int petSpawn =0;		//宠物自动召唤 0关闭  1开启
	private int petSpawnSkillId =-1;	//宠物自动召唤技能
	
	/***铺助设置***/
	private int pointPK =0;		//定点打怪 0关闭 1开启
	private int autofix =1;		//自动修理 0关闭 1开启
	private int pkActorR =100;		//打怪半径 	小（50像素）/中（100像素）/大（200像素）
	private int autoTeam =0;		//自动组队 0关闭 1开启
	private int autoReply =1;		//自动回复 0关闭 1开启
	private String autoMsg="挂机中,勿扰!";		//自动回复的消息

	/***非挂机时启效设置***/
	private int offUserProtect =0;		//是否开启角色保护 0关闭 1开启
	private int offBeastProtect =0;	//是否开启召唤兽保护 0关闭 1开启
	private int offPetProtect =0; 		//是否开启宠物保护 0关闭 1开启
	private int offPickFilter =0;		//是否开启拾起过滤 0关闭 1开启
	private int offAutoFix =0;		//是否开启自动修理 0关闭 1开启

	private FuzePcInstance active;		//要托管的人
	private L2Character target;				//目标
	private L2Character preTarget;			//上一个目标

	private boolean isSendMessage=true;
	private int index;		//索引
	private long now = 0;	//回血开始时间
	private long lastTime = 0;//最后一次回血时间
	private L2PlayerAI owner;
	public L2Skill[] skills;

	private static final int NORMAL_BUFFSKILL_ATTACK = 45;	//普通攻击多少下后开始buff技能攻击

	public FuzeTrusteeInstance(L2PlayerAI own)
	{
		owner=own;
		this.active = (FuzePcInstance)owner.getActor();
	}

	public FuzeTrusteeInstance(FuzePcInstance play)
	{
		this.active = play;
	}

	public void thinkTrustee(CtrlIntention action)
	{
		now = GameTimeController.getGameTicks();
		if(owner == null)
			return ;
		this.active = (FuzePcInstance)owner.getActor();
		this.target = owner.getAttackTarget();
		if(active.isAutoAttack )
		{
			this.autoReHpMp();
			if(getAutofix()==1)	//自动修理是否开启
				this.autoFix();
			if(action == CtrlIntention.AI_INTENTION_ATTACK)
				this.autoAttack();	
		}
		if(getOffUserProtect() == 1){	//角色保护是否开启
			this.autoReHpMp();	
		}
		if(getOffAutoFix() == 1){			//角色自动修理是否开启
			this.autoFix();
		}
	}

	/*------------------------------角色保护--------------------------------*/	
	/**
	 * 自动回HP/MP
	 * @param arg
	 */
	private void autoReHpMp( ){
		if(now < lastTime)
			return;
		if((active.isAutoAttack && getHpoff()==1) || getOffUserProtect()==1)	//角色保护判断
		{
			autoRenewHp(active.getCurrentHp());
		}
		if((active.isAutoAttack && getSpoff()==1) || getOffUserProtect()==1)	//角色保护判断
		{
			autoRenewMp(active.getCurrentMp());
		}
		lastTime = now + 30;			//等4秒  记40 Ticke
	}
	
	/**
	 * 自动喝红药 
	 * @param arg
	 */
	private void autoRenewHp(int curHp)
	{
		if(active ==null || active.isDead())		
			return ;
		
		float cur=curHp;
		float max=active.getMaxHp();
		float percent=(cur/max)*100;
		this.autoBuyRedItem();
			if(percent<getHpCP() )
			{
				L2ItemInstance[] bag=active.getInventory().getCanUseItems();
				L2Item item = null;
				for(L2ItemInstance canUserItem :bag)
				{
					item = canUserItem.getItem();
					if(item.getItemType() == L2EtcItemType.REDPOTION && item.getType2() != L2Item.TYPE2_QUEST)
					{
						IItemHandler handler = ItemHandler.getInstance().getItemHandler(canUserItem.getEtcItem());
						if (handler != null  && item.getItemLvl()<=active.getLevel()) {
							handler.useItem(active, canUserItem);				//使用红药
							break;
						}
					}
				}
			}
	}
	
	/**
	 * 红药少于50 自动买红药
	 * @param arg
	 */
	private void autoBuyRedItem()
	{
		if(getAutoBuyRed()==1 && getRedItemId()>0)							//自动购买
		{			
			autoItem(getRedItemId());
		}
	}
	
	/**
	 * 自动喝蓝药
	 * @param arg
	 */
	private void autoRenewMp(int curMp)
	{
		if(active==null || active.isDead())		
			return ;
		float cur=curMp;
		float max=active.getMaxMp();
		float percent=(cur/max)*100;
		this.autoBuyBlueItem();
		if(percent<getSpCP())
		{
			L2ItemInstance[] bag=active.getInventory().getCanUseItems();
			L2Item item = null;
			for(L2ItemInstance canUserItem :bag)
			{
				item = canUserItem.getItem();
				if(item.getItemType() == L2EtcItemType.BLUEPOTION && item.getType2() != L2Item.TYPE2_QUEST )
				{

					IItemHandler handler = ItemHandler.getInstance().getItemHandler(canUserItem.getEtcItem());
					if (handler != null && item.getItemLvl()<=active.getLevel()) {
						handler.useItem(active, canUserItem);
						break;
					}
				}
			}
		}
	}

	/**
	 * 蓝药少于50 自动买蓝药
	 * @param arg
	 */
	private void autoBuyBlueItem()
	{
		if(getAutoBuyBlue()==1 && getBlueItemId()>0)			//自动购买
		{
			autoItem(getBlueItemId());
		}
	}
	
	/**
	 *  自动买道具
	 * @param arg
	 */
	private void autoItem(int itemId)
	{
		List<L2ItemInstance> itemList=active.getInventory().getItemsByItemId(itemId);
		int itemCount=0;
		for(L2ItemInstance item:itemList)
		{
			itemCount+=item.getCount();
		}
		if(!(itemList!=null &&  itemCount>=50))
		{
			float _storeBuyRate = active.getTemplate().getBaseShopBuyRate();
//			int buyPrice = Math.round(ItemTable.getInstance().getTemplate(itemId).getBuyPrice() * _storeBuyRate * 50); // -- 计算银元数
//			int money=active.getMoneyNote();	//玩家的银票
//
//			if(buyPrice > money){
//				if (isSendMessage){
//					active.sendMessage("银票不足，无法自动购买药水");
//					isSendMessage=false;
//				}
//				return;
//			}
			active.buyItemsAuto(itemId, 50);
			isSendMessage=true;
		}
	}

	/*------------------------------技能战斗--------------------------------*/
	/**
	 * 角色自动攻击
	 * @param arg
	 */
	private void autoAttack()
	{	
		if (target == null || target instanceof FuzePcInstance ) {
			return;
		}
		
		if(preTarget!=null && preTarget == target)	//判断最后一次打的怪物和当前怪物是不是同一个
		{
			actorAnalysis(target,index);
		}else
		{
			index = 0;
			actorAnalysis(target,index);
			this.preTarget = target;
		}
	}

	private void actorAnalysis(L2Character target,int action)
	{
		startNormalAttack(action);
	}

	//普通怪攻击方式
	private void startNormalAttack(int action)
	{
		index++;
		if(index > 45)
			index = 0;
		if(action%10==0){
			this.autoSkillAttack();	
		}
		else if(action==NORMAL_BUFFSKILL_ATTACK)
			autoBuffSkillAttack();
	}

	/**
	 * 角色技能攻击
	 * @param arg
	 */
	private void autoSkillAttack()
	{		
		if(getIsUseSkill()==1 && getSkillId_1()>0)
		{
			L2Skill skill_1=getSkillById(getSkillId_1());			
			if(isDoCast(skill_1, active)){
				owner.setIntention(CtrlIntention.AI_INTENTION_CAST,skill_1, target);// 设置player进攻这个actor
				return ;
			}
			L2Skill skill_2=getSkillById(getSkillId_2());
			if(isDoCast(skill_2, active)){
				owner.setIntention(CtrlIntention.AI_INTENTION_CAST,skill_2, target);// 设置player进攻这个actor
				return ;
			}
			L2Skill skill_3=getSkillById(getSkillId_3());
			if(isDoCast(skill_3, active)){
				owner.setIntention(CtrlIntention.AI_INTENTION_CAST,skill_3, target);// 设置player进攻这个actor
				return ;
			}
			L2Skill skill_4=getSkillById(getSkillId_4());
			if(isDoCast(skill_4, active)){
				owner.setIntention(CtrlIntention.AI_INTENTION_CAST,skill_4, target);// 设置player进攻这个actor
				return ;
			}
		}	
	}

	/**
	 * 角色Buff技能攻击
	 * @param arg
	 */
	private void autoBuffSkillAttack()
	{
		if(getIsUseState()==1 && getStateId_1()>0)
		{
			L2Skill state_1=getSkillById(getStateId_1());
			if(isDoCast(state_1, active)){
				owner.setIntention(CtrlIntention.AI_INTENTION_CAST,state_1, target);// 设置player进攻这个actor
				return ;
			}
			L2Skill state_2=getSkillById(getStateId_2());
			if(isDoCast(state_2, active)){
				owner.setIntention(CtrlIntention.AI_INTENTION_CAST,state_2, target);// 设置player进攻这个actor
				return ;
			}
			L2Skill state_3=getSkillById(getStateId_3());
			if(isDoCast(state_3, active)){
				owner.setIntention(CtrlIntention.AI_INTENTION_CAST,state_3, target);// 设置player进攻这个actor
				return ;
			}
			L2Skill state_4=getSkillById(getStateId_4());
			if(isDoCast(state_4, active)){
				owner.setIntention(CtrlIntention.AI_INTENTION_CAST,state_4, target);// 设置player进攻这个actor
				return ;
			}
		}	
	}
	
	public L2Skill getSkillById(int skillId) {
		if(skills == null)
			skills = active.getAllSkills();
		for (L2Skill skill : skills) {
			if (skill.getId() == skillId) {
				return skill;
			}
		}
		return null;
	}
	
	/**
	 * 检查是否可以施法
	 * 
	 * @param skill
	 * @param FuzePcInstance
	 * @return
	 */
	public boolean isDoCast(L2Skill skill , FuzePcInstance pc)
	{
		if(skill==null || pc.isSkillDisabled(skill.getId())){	//如果技能是空或者是被禁止的技能
			return false;
		}
		FuzeSkillCoolDown skillcool=pc.getSkillCoolList();
		if(skillcool.isSkillCoolDown(skill)){			//检查技能是否冷却   在冷却中 false  不在反回true
			return false;
		}
			
		if(pc.getCurrentMp()< skill.getMpConsume()){	// 检查是否有要求的足够的MP
			return false;
		}
		
		if(pc.getCurrentHp() < skill.getHpConsume()){	//检查是否有要求的足够的HP
			return false;
		}
		return true;
	}
	
	/*------------------------------其它--------------------------------*/
	/**
	 * 角色自动回复
	 * @param arg
	 */
	public void autoReply(int type)
	{
		FuzePcInstance tar=(FuzePcInstance) target;
		
		FuzeTrusteeInstance targerInfo=tar.getAI().getTrustee();
		if(targerInfo.getAutoReply() == 1)
		{
			active.sendPacket(new CreatureSay(target.getObjectId(), type,  target.getName(), targerInfo.getAutoMsg()));
			target.sendPacket(new CreatureSay(target.getObjectId(), type, "->" + active.getName(), targerInfo.getAutoMsg()));  //-- 发送成功提示信息给消息发送者
		}
		return ;
	}

	/**
	 * 角色自动组队
	 * @param arg
	 */
	public void autoTeam() {
		FuzePcInstance tar = (FuzePcInstance) target;
		FuzeTrusteeInstance targerInfo = tar.getAI().getTrustee();
		if (targerInfo.getAutoTeam() == 1) {
			tar.joinParty(active.getParty());
			return;
		} else {
			if (active.getParty().getMemberCount() < 2) {
				active.getParty().getPartyMembers().clear();
				active.setParty(null);
			}
			active.sendPacket(new SystemMessage(SystemMessageId.INVATATION_HAS_BE_REFUSED));// 拒绝你的邀请（系统消息）
			return;
		}
	}

	/**
	 * 角色自动修理
	 * @param arg
	 */
	public void autoFix()
	{
			L2ItemInstance[] items = active.getInventory().getAllEquipItems();  //-- 获取玩家装备列表
			if (items != null) {
				for (int i = 0; i < items.length; i++) {
					if (items[i] == null)
						continue;
					if (items[i].getEndurance()<=0) {  //-- 判断是否可修理
						FuzeRepairerInstance.doRepair(active);
					}
				}
			}
	}

	/*------------------------------*物品过滤--------------------------------*/
	public void onStart() {
		active.registDropItemSelectInterface(this);
	}

	public void onExit() {
		active.removeDropItemSelectInterface();
	}

	public void initDrop()
	{
		if(getOffPickFilter()==1){
			active.registDropItemSelectInterface(this);
		}else{
			active.removeDropItemSelectInterface();
		}
	}

	public boolean canSelect(String process,int itemId , L2Object reference) {
		L2Item item = ItemTable.getInstance().getTemplate(itemId);
		int itemgrade=0;
		if (item == null) {
			return false;
		}
		// 是否是 怪物
		boolean isMob = reference instanceof L2Attackable;
		if (isMob) {
			int mobgrade= ((L2Attackable) reference).getChampion();
			int moblvl=((L2Attackable) reference).getLevel();
			itemgrade = item.getItemGrade();
			// 非定制的话 ,且是由怪物掉落的话
			// 那么获得 物品的品质
			if (itemgrade == -1 && (mobgrade !=-1 || moblvl != -1)) {
				// 获得 物品品质 ， 如果不存在 不生产物品
				itemgrade = MobItemCreateConfig.getInstance().getMobItemGrade(mobgrade, moblvl);
			} // 默认品质 为法器
		}
		
		boolean result = true;
		if(ItemDropManage.isDropItem(process)){
			if(item.isEtcItem())
			{
				L2EtcItemType type=(L2EtcItemType)item.getItemType();	//道具类型
				result = canSelect(type);
			}else{
				if(itemgrade<=0 && getFaEquipment()==0){		//法器
					result= false;
				}else if(itemgrade==1 && getBaoEquipment()==0){		//宝器
					result= false;	
				}else if(itemgrade==2 && getLingEquipment()==0){		//灵器
					result= false;
				}else if(itemgrade==3 && getZhiEquipment()==0){		//至宝
					result= false;
				}else if(itemgrade==4 && getShenEquipment()==0){		//神器
					result= false;
				}
			}
		}
		return result;
	}

	@Override
	public boolean canSelect( String process,  L2ItemInstance item , L2Object reference) {
		if (item == null)
			return false;
		boolean result = true;
		if(ItemDropManage.isDropItem(process)){
			if(item.isEtcItem()){
				L2EtcItemType type=(L2EtcItemType)item.getItemType();	//道具类型
				result = canSelect(type);
			}
			if(!item.isEtcItem())
			{
				ItemGradeType t=item.getItemGradeType();		//物品品质
				result = canSelect(t);
			}
		}
			
		return result;
	}
	
	public boolean canSelect(L2EtcItemType type)
	{
		boolean result = true;
		switch(type)
		{
		case REDPOTION:		//红药
			if(getSolution() == 0)
				result= false;
			break;
		case BLUEPOTION:		//蓝药
			if(getSolution() == 0)
				result= false;
			break;
		case PURPLEPOTION:		//紫药
			if(getSolution() == 0)
				result= false;
			break;
		case GREENPOTION:		//绿药
			if(getSolution() == 0)
				result= false;
			break;
		case JEWEL:		//宝石
			if(getGemstone() == 0)
				result= false;
			break;
		case SCROLL:    //卷轴
			if(getScroll() == 0)
				result=false;
			break;
		}
		return result;
	}
	
	public boolean canSelect(ItemGradeType t)
	{
		boolean result = true;
		switch(t)
		{
		case TALISMAN:		//法器
			if(getFaEquipment() ==0)
				result=false;
			break;
		case BAODEVICE:		//宝器
			if(getBaoEquipment() ==0)
				result=false;
			break;
		case LINGDEVICE:	//灵器
			if(getLingEquipment() ==0)
				result=false;
			break;
		case TREASURE:		//至宝
			if(getZhiEquipment() ==0)
				result=false;
			break;
		case HORL:			//神器
			if(getShenEquipment() ==0)
				result=false;
			break;
		}
		return result;
	}
	
	public FuzePcInstance getActive() {
		return active;
	}

	public void setActive(FuzePcInstance active) {
		this.active = active;
	}
	
	public L2Character getTarget() {
		return target;
	}

	public void setTarget(L2Character target) {
		this.target = target;
	}
	public int getSolution() {
		return solution;
	}
	public void setSolution(int solution) {
		this.solution = solution;
	}
	public int getGemstone() {
		return gemstone;
	}
	public void setGemstone(int gemstone) {
		this.gemstone = gemstone;
	}
	public int getScroll() {
		return scroll;
	}
	public void setScroll(int scroll) {
		this.scroll = scroll;
	}
	public int getFaEquipment() {
		return faEquipment;
	}
	public void setFaEquipment(int faEquipment) {
		this.faEquipment = faEquipment;
	}
	public int getBaoEquipment() {
		return baoEquipment;
	}
	public void setBaoEquipment(int baoEquipment) {
		this.baoEquipment = baoEquipment;
	}
	public int getLingEquipment() {
		return lingEquipment;
	}
	public void setLingEquipment(int lingEquipment) {
		this.lingEquipment = lingEquipment;
	}
	public int getZhiEquipment() {
		return zhiEquipment;
	}
	public void setZhiEquipment(int zhiEquipment) {
		this.zhiEquipment = zhiEquipment;
	}
	public int getShenEquipment() {
		return shenEquipment;
	}
	public void setShenEquipment(int shenEquipment) {
		this.shenEquipment = shenEquipment;
	}
	public int getIsUseSkill() {
		return isUseSkill;
	}
	public void setIsUseSkill(int isUseSkill) {
		this.isUseSkill = isUseSkill;
	}
	public int getSkillId_1() {
		return skillId_1;
	}
	public void setSkillId_1(int skillId_1) {
		this.skillId_1 = skillId_1;
	}
	public int getSkillId_2() {
		return skillId_2;
	}
	public void setSkillId_2(int skillId_2) {
		this.skillId_2 = skillId_2;
	}
	public int getSkillId_3() {
		return skillId_3;
	}
	public void setSkillId_3(int skillId_3) {
		this.skillId_3 = skillId_3;
	}
	public int getSkillId_4() {
		return skillId_4;
	}
	public void setSkillId_4(int skillId_4) {
		this.skillId_4 = skillId_4;
	}
	public int getIsUseState() {
		return isUseState;
	}
	public void setIsUseState(int isUseState) {
		this.isUseState = isUseState;
	}
	public int getStateId_1() {
		return stateId_1;
	}
	public void setStateId_1(int stateId_1) {
		this.stateId_1 = stateId_1;
	}
	public int getStateId_2() {
		return stateId_2;
	}
	public void setStateId_2(int stateId_2) {
		this.stateId_2 = stateId_2;
	}
	public int getStateId_3() {
		return stateId_3;
	}
	public void setStateId_3(int stateId_3) {
		this.stateId_3 = stateId_3;
	}
	public int getStateId_4() {
		return stateId_4;
	}
	public void setStateId_4(int stateId_4) {
		this.stateId_4 = stateId_4;
	}
	public int getHpCP() {
		return hpCP;
	}
	public void setHpCP(int hpCp) {
		hpCP = hpCp;
	}
	public int getSpCP() {
		return spCP;
	}
	public void setSpCP(int spCp) {
		spCP = spCp;
	}
	public int getAutoBuyRed() {
		return autoBuyRed;
	}
	public void setAutoBuyRed(int autoBuyRed) {
		this.autoBuyRed = autoBuyRed;
	}
	public int getRedItemId() {
		return redItemId;
	}
	public void setRedItemId(int redItemId) {
		this.redItemId = redItemId;
	}
	public int getAutoBuyBlue() {
		return autoBuyBlue;
	}
	public void setAutoBuyBlue(int autoBuyBlue) {
		this.autoBuyBlue = autoBuyBlue;
	}
	public int getBlueItemId() {
		return blueItemId;
	}
	public void setBlueItemId(int blueItemId) {
		this.blueItemId = blueItemId;
	}
	public int getHpBeast() {
		return hpBeast;
	}
	public void setHpBeast(int hpBeast) {
		this.hpBeast = hpBeast;
	}
	public int getHealSkillId() {
		return healSkillId;
	}
	public void setHealSkillId(int healSkillId) {
		this.healSkillId = healSkillId;
	}
	public int getDealSpawn() {
		return dealSpawn;
	}
	public void setDealSpawn(int dealSpawn) {
		this.dealSpawn = dealSpawn;
	}
	public int getSpawnSkillId() {
		return spawnSkillId;
	}
	public void setSpawnSkillId(int spawnSkillId) {
		this.spawnSkillId = spawnSkillId;
	}
	public int getHpPet() {
		return hpPet;
	}
	public void setHpPet(int hpPet) {
		this.hpPet = hpPet;
	}
	public int getPetHealSkillId() {
		return petHealSkillId;
	}
	public void setPetHealSkillId(int petHealSkillId) {
		this.petHealSkillId = petHealSkillId;
	}
	public int getPetSpawn() {
		return petSpawn;
	}
	public void setPetSpawn(int petSpawn) {
		this.petSpawn = petSpawn;
	}
	public int getPetSpawnSkillId() {
		return petSpawnSkillId;
	}
	public void setPetSpawnSkillId(int petSpawnSkillId) {
		this.petSpawnSkillId = petSpawnSkillId;
	}
	public int getPointPK() {
		return pointPK;
	}
	public void setPointPK(int pointPk) {
		pointPK = pointPk;
	}
	public int getAutofix() {
		return autofix;
	}
	public void setAutofix(int autofix) {
		this.autofix = autofix;
	}
	public int getPkActorR() {
		return pkActorR;
	}
	public void setPkActorR(int pkActorR) {
		this.pkActorR = pkActorR;
	}
	public int getAutoTeam() {
		return autoTeam;
	}
	public void setAutoTeam(int autoTeam) {
		this.autoTeam = autoTeam;
	}
	public int getAutoReply() {
		return autoReply;
	}
	public void setAutoReply(int autoReply) {
		this.autoReply = autoReply;
	}
	public String getAutoMsg() {
		if(autoMsg == null)
			autoMsg="";
		return autoMsg;
	}
	public void setAutoMsg(String autoMsg) {
		this.autoMsg = autoMsg;
	}
	public int getOffUserProtect() {
		return offUserProtect;
	}
	public void setOffUserProtect(int offUserProtect) {
		this.offUserProtect = offUserProtect;
	}
	public int getOffBeastProtect() {
		return offBeastProtect;
	}
	public void setOffBeastProtect(int offBeastProtect) {
		this.offBeastProtect = offBeastProtect;
	}
	public int getOffPetProtect() {
		return offPetProtect;
	}
	public void setOffPetProtect(int offPetProtect) {
		this.offPetProtect = offPetProtect;
	}
	public int getOffPickFilter() {
		return offPickFilter;
	}
	public void setOffPickFilter(int offPickFilter) {
		this.offPickFilter = offPickFilter;
		if(offPickFilter==1){	 //开启拾起过滤
			onStart();		
		}
	}
	public int getHpoff() {
		return hpoff;
	}
	public void setHpoff(int hpoff) {
		this.hpoff = hpoff;
	}
	public int getSpoff() {
		return spoff;
	}
	public void setSpoff(int spoff) {
		this.spoff = spoff;
	}
	public int getHpBeastOff() {
		return hpBeastOff;
	}
	public void setHpBeastOff(int hpBeastOff) {
		this.hpBeastOff = hpBeastOff;
	}
	public int getHpPetOff() {
		return hpPetOff;
	}
	public void setHpPetOff(int hpPetOff) {
		this.hpPetOff = hpPetOff;
	}
	public int getOffAutoFix() {
		return offAutoFix;
	}
	public void setOffAutoFix(int offAutoFix) {
		this.offAutoFix = offAutoFix;
	}
	public L2Skill[] getSkills() {
		return skills;
	}
	public void setSkills(L2Skill[] skills) {
		this.skills = skills;
	}
}


